package ytdp.careagle.com.ytdp.myview.indexbar_packet;

import android.text.TextUtils;

import com.mcxtzhang.indexlib.IndexBar.bean.BaseIndexPinyinBean;


/**
 * Created by zhangxutong .
 * Date: 16/08/28
 */

public class CityBean extends BaseIndexPinyinBean {

    private String city;//城市名字
    private boolean isTop;//是否是最上面的 不需要被转化成拼音的
    private int type;//是否是最上面的 不需要被转化成拼音的
    private String tag;//是否是最上面的 不需要被转化成拼音的

    public CityBean() {
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        this.tag = tag;
    }

    public CityBean(String city) {
        this.city = city;
    }

    public String getCity() {
        return city;
    }

    public CityBean setCity(String city) {
        this.city = city;
        return this;
    }

    public boolean isTop() {
        return isTop;
    }

    public CityBean setTop(boolean top) {
        isTop = top;
        return this;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    @Override
    public String getTarget() {
        return city;
    }

    @Override
    public boolean isNeedToPinyin() {
        return !isTop;
    }

    @Override
    public String getSuspensionTag() {
        String text;
        if (TextUtils.isEmpty(tag)){
            text=super.getSuspensionTag();
        }else {
            text=tag;
        }
        return text;
    }

    @Override
    public boolean isShowSuspension() {
        return !isTop;
    }
}
